export function useScroller({
  x = 0,
  y = 0,
  isSmooth = false,
}: {
  x: number;
  y: number;
  isSmooth?: boolean;
}) {
  if (!window) return;

  const scrollTo = () => {
    window.scrollTo({
      top: y,
      left: x,
      behavior: isSmooth ? "smooth" : "auto",
    });
  };

  return scrollTo;
}
